package com.sgolub.commanndsonline.service.entity;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sgolub.commanndsonline.dao.entity.UserOrderDAO;
import com.sgolub.commanndsonline.domain.entity.UserOrder;

@Service
public class UserOrderServiceImpl implements UserOrderService {

	@Autowired
	private UserOrderDAO uгserOrderDAO;
	
	@Transactional
	public UserOrder get(Integer id) {
		return uгserOrderDAO.get(id);
	}

	@Transactional
	public void add(UserOrder userOrder) {
		uгserOrderDAO.add(userOrder);
	}

	@Transactional
	public void update(UserOrder userOrder) {
		uгserOrderDAO.update(userOrder);
	}

	@Transactional
	public void remove(Integer id) {
		uгserOrderDAO.remove(id);
	}

	@Transactional
	public List<UserOrder> list() {
		return uгserOrderDAO.list();
	}

	@Transactional
	public List<UserOrder> filter(String sortByColumn, String sortMode, 
			  					  HashMap<String, String> filtersMap) {
		return uгserOrderDAO.filter(sortByColumn, sortMode, filtersMap);
	}

	@Transactional
	public List<UserOrder> listCurrentUserOrder(Integer userId){
		return uгserOrderDAO.listCurrentUserOrder(userId);
	}
	
}
